#include <string>
#include <jni.h>

class MyCppClass{
public:
    std::string greet(){
        return "Hello from C++ Class member function.";
    }
};

// 该函数将被Java代码调用
extern "C"
JNIEXPORT jstring JNICALL Java_com_example_jnivxbuffer_MainActivity_stringFromJNI(JNIEnv* env, jobject) {
    MyCppClass obj;
    std::string hello = "Hello from C++ function.";
    std::string greeting = hello + " " + obj.greet();
    return env->NewStringUTF(greeting.c_str());
}